package com.lmt_17;

import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class Myrunable implements Runnable{
    //private int count;
    AtomicInteger count = new AtomicInteger(); // 定义乐观锁对象
    //Lock lk = new ReentrantLock();
    @Override
    public void run() {
        for (int i = 0; i<100; i++){
            //lk.lock();
            System.out.println("count =====>"+count.incrementAndGet());
            //lk.unlock();
        }
    }
}
